package com.gonsin.easycount.plugin;

import java.lang.reflect.Type;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface OuterCache {
    void cleanSet(Collection<String> setNames);

    void cleanSet(String setName);

    void cleanHash(String hashName);

    void putHash(String hashName, String key, Object value);

    void addSet(String setName, Object value);


    void addList(String listName, Object value);

    <T> T getHash(String hashName, String key, Type clazz);

    <T> Map<String, T> getHash(String hashName, Type clazz);

    void removeSet(String setName, String key);

    long sizeOfHash(String hashName);

    long sizeOfSet(String setName);

    <T> Set<T> getSet(String setName, Class<T> clazz);

    /**
     * 是否包含某个hash
     */
    boolean containHash(String hashName);

    /**
     * 获取一个
     */
    <T> T get(String key, Class<T> clazz);

    /**
     * 设置一个
     */
    <T> void put(String key, T t);

    /**
     * 删除一个value
     */
    void cleanValue(String key);

    <T> List<T> getList(String key, Type clazz);

    void cleanList(String key);
}
